import axios from '@/utils/request';

/**
 * 获取银行流水日志查询分页列表
 */
 export async function QueryBankstatementPageList(params) {
    const res = await axios.post('/Bankstatement/QueryBankstatementPageList',params);
    if (res.data.code === 200) {
        return res.data.data;
    }
    return Promise.reject(new Error(res.data.msg));
}

/**
 * 根据id获取银行流水日志
 */
 export async function GetModelById(id) {
    const res = await axios.get('/Bankstatement/GetModelById/'+id);
    if (res.data.code === 200) {
        return res.data.data;
    }
    return Promise.reject(new Error(res.data.msg));
}

/**
 * 获取所有的银行账户
 */
export async function GetAllBackAccount() {
    const res = await axios.get('/Bankstatement/GetAllModels');
    if (res.data.code === 200) {
        return res.data.data;
    }
    return Promise.reject(new Error(res.data.msg));
}

/**
 * 更新银行流水日志
 */
 export async function UpdateBankstatement(params) {
    const res = await axios.post('/Bankstatement/UpdateBankstatement',params);
    if (res.data.code === 200) {
        return res.data.msg;
    }
    return Promise.reject(new Error(res.data.msg));
}

/**
 * 删除银行流水日志
 */
 export async function DeleteBankstatement(id) {
    const res = await axios.post('/Bankstatement/DeleteBankstatement?id='+id);
    if (res.data.code === 200) {
        return res.data.msg;
    }
    return Promise.reject(new Error(res.data.msg));
}

 /**
  * 修改银行流水日志状态信息
  */
 export async function UpdateStatus(params) {
    const res = await axios.post('/Bankstatement/UpdateStatus',params);
    if (res.data.code === 200) {
        return res.data.msg;
    }
    return Promise.reject(new Error(res.data.msg));
  }